#! /usr/bin/perl -w
use strict;

my ($enc, $pep);
if ($#ARGV < 0) {
   print "Enter encoding (sp for sparse or bl for blosom):";
   $enc = <STDIN>;
   chomp $enc;
   print "Enter no. of peptides:";
   $pep = <STDIN>;
   chomp $pep;
}
if ($#ARGV == 0) {
   my $flag = 1;
   while ($flag == 1) {
      print "Did you enter encoding (enc) or no. of peptides (pep)?:";
      my $ans = <STDIN>;
      chomp $ans;
      if ($ans eq "enc") {
         $enc = $ARGV[0];
         print "Enter no. of peptides:";
         $pep = <STDIN>;
         chomp $pep;
         $flag = 0;
      }  
      if ($ans eq "pep") {
         $pep = $ARGV[0];
         print "Enter encoding (sp for sparse or bl for blosom):";
         $enc = <STDIN>;
         chomp $enc;
         $flag = 0;
      } 
   }
}
if ($#ARGV == 1) {
   $enc = $ARGV[0];
   $pep = $ARGV[1];
} 
die "Too many arguments\n" if ($#ARGV > 1);

my $train = "train_$enc\_$pep\_enc";
my $test = "test_$enc\_$pep\_enc";

my @nh = (2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 50);
system "mkdir -p -m 777 syn";


for (my $i = 0; $i <= $#nh; $i++) {
	system "/home/projects/plichta/Jesper/aib-nn/src/nnbackprop -nh $nh[$i] -ec 150 -nt 5 -tf pred_$enc/$test -nc 10000 -syn syn/syn_$enc\_$pep\_nh$nh[$i].dat pred_$enc/$train &";
	
}


#system "nnbackprop -nh 10 -tf c000_sp -syn syn_sp_my.dat f000_sp"















